package rigo.ricard.pris.rs.ac.uns.dmi.listener;

import java.util.List;

import rigo.ricard.pris.rs.ac.uns.dmi.actions.InitAction;
import ai.aitia.dbinit.beans.VocabularyElement;

import com.liferay.portal.ModelListenerException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.model.BaseModelListener;
import com.liferay.portlet.asset.model.AssetVocabulary;

public class CustomVocabularyListener extends BaseModelListener<AssetVocabulary> {

	private static final Log log = LogFactoryUtil.getLog(CustomVocabularyListener.class);

	private static List<VocabularyElement> vocabularyElements = null;

	@Override
	public void onBeforeRemove(AssetVocabulary model) throws ModelListenerException {
		if (model.getName().equals(InitAction.VOCABULARY_NAME)) {
			throw new ModelListenerException("vocabulary can not be delete");
		}
	}


}
